AN002 - Example of use of Danaher drives with MicroQMove connected to CANOpen bus

In this “application note” explains how to control the Danaher drives connected with a MicroQMove device using the CANOpen bus. In this way the user can figure out how to navigate at the time of construction of a communication network. The MicroQMove device in this example is an R502BF.

Bus expansion

The 502BF product is a programmable system consists of a main processing unit (CPU) and a series of cards that manage local inputs and outputs internally connected via a data bus. On this internal bus identifies a number (depends to the model) of card slots and numbered starting to 2. For example the 502BF product allows you to install up to 5 cards, then the slot numbering on the bus will be from 2 to 6.
When you create a CANOpen network, the number of slots is extended up to 12 thus making available additional I/O present on devices that implement the DS-401 profiles of communication “Communication profile for generic I/O modules” and DS-402 “Device Profile Drives and Motion Control”. The CANOpen network only supports a configuration with devices that belong to the same profile, so it is not possible to have generic I/O modules with the same network drives. Also when you use a network configured for devices by DS-402 type (driver), These must all be of the same manufacturer. In this document, we'll discuss connecting and setting up a network in which all devices are drives Danaher.

The product is equipped with a CANbus port that implements a CANOpen standard communication protocol. This Protocol is used to implement a process communication We can define simplistically a “internal bus expansion”. This means that for all intents are used process data communication to present to the system I/O information coming from the CANOpen bus and this information is addressed as if they belonged to additional card slots present “virtually” on the position from 7 to 12. This solution makes it easy and intuitive CANOpen network configuration.

Short description of CANOpen

The CANOpen is a communication protocol based on CAN serial bus. The CANOpen expect the hardware of a device connected has a CAN receiver (CAN-transceiver) and a CAN controller as established by the ISO 11898. The CANOpen communication profile, CiA DS-301, implements both cyclic communications that event-oriented communication, thus reducing the load on the bus while maintaining low reaction times. You can achieve high performance in terms of the amount of Exchange data even at relatively low speeds, reducing problems related to EMC rules and wiring costs. The physical medium used by the CANOpen Protocol is a line bus differential pair with common return complies with ISO 11898. The bus length is limited by the speed of communication as follows:

Bitrate Maximum bus length
1 Mbps 25 m
500 kbps 100 m
250 kbps 250 m
125 kbps 1000 m

Creation and configuration of a network

Here are the steps to the creation and configuration of a network:

;------------------------------
; Internal device declaration
;------------------------------
INTDEVICE
FieldB1 CANOPEN 0004 500 0

In the above example was declared a device with sample time 4ms and 500kbps comunication rate

;----------------------
; Qmove Bus declaration
;----------------------
BUS
1 502BF 99
2 . .
3 . .
4 . .
5 . .
6 . .
7 C402A .

In the example we have chosen the speed 500 kbps. There is also another way of setting the rate to be used when you think would be necessary to change the speed even without intervention in the Qcl application. In this case you set zero in the speed during the declaration of the device and then choose the speed through the dip-switches:

Dip 5 Dip 7 Bitrate
off off 125 kbps
off on 250 kbps
on off 500 kbps
on on 1 Mbps

* use the software provided by the manufacturer of the drive for setting parameters. Open the Basic setting by clicking on the button:

Parameterization and drive configuration

For correctly manage from the QEM device, the Danaher driver must be properly configured. Here are the steps to do this, This refers to the software that comes with the drive:

  1. AENA 0: defines the State of the art software enabling drive ignition, setting it to 0 will be provided by 502BF and not automatically enabled
  2. PTBASE 16: defines the interval between two SYNC message for for the implementation of the set-point position and sending the position of axles and is calculated using the follow formula: PTBASE = 4*(tcamp CANOPEN device)
  3. FPGA 3: enables handling of synchronizing multiple drives via CANOpen
  4. SYNCSRC 3: abilita la sincronizzazione di più azionamenti via CANOpen
  5. BOOT 1: enable quick Boot mode on power up. The drive will take about 2 seconds to get ready instead of 15 seconds
  6. PRBASE 16: imposta la risoluzione di posizione interna a 2^16 per essere compatibile con il prodotto 502BF
  7. PGEARI 65536: numerator of position resolution
  8. PGEARO 65536: denominator of position resolution

Drive calibration

After setting the parameters on driving we can execute the axis calibration, which you should perform in two stages:

Speed loop calibration

To calibrate the speed loop you should: set on the screen OPMODE 0 = Digital Speed. Open the SPEED screen and set the acceleration and deceleration ramps at a value of approximately 100ms (depending on the load connected to the motor). To execute the motor movements to execute using the OSCILLOSCOPE screen functions Speed F6 or F8 by clicking on the Start button in the Service panel.

Now click the Start button Oscilloscope showing the positioning of the motor. Act on the parameters of the SPEED screen:

Increase the gain Kp until the motor starts to vibrate, then reduce it to a value that is stable (too low a value representing a slow response of the motor, while too high value makes the motor too brusque and swinging). The Tn parameter, in milliseconds, represents the integral time of speed proportional gain: This value increases with the increase of the size of the motor and with increasing the load inertia. Too low value of Tn with large inertia involve sudden movements of the motor and strong overshoot, while too high values result in a slow response of the engine. If changing Kp and Tn you don't get a good calibration you can use the PID-T2 parameter: a low-pass filter on the proportional gain of speed: too low or too high makes the answer too rapid or too slow axis respectively.

Calibration of the position loop

At the end of the calibration of the speed loop switches to position ring calibration, by setting the acceleration and deceleration Ramp parameters to 1ms and OPMode at the value 5)Placing external movement to work mode CanOpen with 502BF.
Open the Qview application named DEMO_CANOPEN_DRIVE. This application monitors a drive with address nr.1 with rate 500 kbps. Upload the application to the device and give RUN to the CPU.
By setting the gbtest variable = 3,the drive starts making a series of movements in two dimensions. To change the acceleration times refer to an01 (EANPOS) device while locating dimensions refer to code in the MOVEMENT unit.

:info:Note:
If the direction of movement is incorrect actuate the ASCII DIR control of the drive. Do not actuate the CNTREV control of the device that must remain in the default state (st_cntrev = 0).

Open the position screen and go to modify the parameters of the position ring Kv (position proportional gain) and Ff (Feed Forward factor) in order to test the behavior of the axis.
The Feed Forward factor determines the percentage by which the speed factor is considered in the calculation of the position feedback.
Even in this case you can check the error values with Oscilloscope tool.

These designations for calibration must be understood only as a trace. Refer to the official documentation of the drive for more precise informations.

L'applicativo DEMO_CANOPEN_DRIVE

Questo applicativo di esempio implementa tutto il codice necessario per la gestione di un drive comandato via CANOpen. Può essere utilizzato come codice di esempio o come punto di partenza per sviluppare la propria applicazione.
L'applicativo è composto da due unità: CANOPEN e MOVEMENT.

MOVEMENT è una semplice unità che implementa una sequenza di movimenti. La variabile gbtest a seconda del valore può implementare le seguenti sequenze:
0 = nessuna operazione
1 = movimento continuo tra due quote (0 e 50000). Verso quota zero movimento normale, verso quota 50000 movimento in limitazione di coppia e con errore inseguimento disabilitato
2 = avvio procedura di homing
3 = movimento continuo tra due quote (0 e 10000)

CANOPEN è destinato alla gestione della rete CANOpen. È l'unica unità che fa uso del device; essa esegue le seguenti macro operazioni:

La parte gestione operazioni continue è implementata nella procedura Qcl chiamata DR_GET_VALUES, è utilizzata per leggere alcuni valori dal drive attraverso degli SDO. Questi valori vengono messi su delle variabili e resi disponibili per le altre unità. Sono sempre operazioni di lettura. Più variabili vengono lette e più bassa sarà la frequenza di aggiornamento del dato.

La parte gestione operazioni a richiesta è implementata nella procedura QCL DR_REQUEST, è utilizzata per tutte quelle operazioni che devono essere eseguite ad evento (per esempio una scrittura di un parametro). L'evento deve essere scatenato in un'altra unità.
Per scatenare l'evento bisogna impostare un valore nella variabile gbDrRequest, per attendere la conclusione dell'operazione bisogna attendere che lo stesso valore venga impostato nella variabile gbDrAnswer. Ogni operazione può avere una o più variabili di scambio valore. Vediamo una tabella riassuntiva delle operazioni ora implementate.

OperazioneVariabili QclDescrizioni
imposta l'azionamento in trajectory modenessunaquesta richiesta imposta l'azionamento in trajectory mode.
Da questo momento in poi la posizione è controllata dallo strumento 502BF.
avvia procedura di homingvariabili di impostazione:
gbHomType, gbHomDir, glHomVel, glHomAcc, glHomDec, glHomOff
variabili di stato: gfHomActive, gfHomOk, gfHomError
questa richiesta avvia una procedura di homing. Prima di avviare questa richiesta impostare le variabili corrispondenti. Durante la procedura la variabile di stato gfHomActive viene posta a 1. Al termine della procedura se gfHomOk viene posta a 1 la procedura si è conclusa correttamente, se invece gfHomError viene posta ad 1 allora la procedura si è conclusa in modo errato.
La procedura utilizza l'homing del drive implementato dal parametro ASCII NREF.
Fare riferimento alla descrizione di questo comando.
imposta limite di corrente motoreglCurrLimquesta procedura imposta il limite massimo di corrente nel motore al valore contenuto nella variabile glCurrLim
imposta limite di errore inseguimentoglMaxFErrquesta procedura imposta il limite massimo di errore inseguimento con il valore contenuto nella variabile glMaxFErr

Modo di funzionamento

L'azionamento viene comandato mediante l'invio via CANOpen delle informazioni di posizione. Questo significa che all'azionamento è delegato il compito di realizzare la regolazione di corrente, velocità e posizione.
Le informazioni che transitano via CANOpen sono sempre in forma relativa e non assoluta. Questo significa che l'azionamento muove il motore senza conoscere la posizione assoluta e quindi senza avere dei limiti software (che sono invece implementati nel device del prodotto 502BF).
La posizione reale del motore viene letta via CANOpen e resa disponibile nei parametri encoder e posit del device stesso. La risoluzione di questa informazione dipende dal trasduttore utilizzato nell'azionamento. Se si utilizza un resolver con il parametro PRBASE al valore 16, ad ogni giro del motore verrà contato un valore pari a 65536. In pratica però per default esiste un fattore di divisione pari a 4 tra l'informazione fornita dal drive e quella letta dal 502BF. Questo fattore è programmabile attraverso un comando QDO del device CANOPEN. Il fattore di divisione è stato inserito per evitare effetti di overflow durante la lettura. È infatti necessario (come per tutti gli altri device interni) che ad ogni tempo di campionamento del device la posizione non sia modificata per un valore maggiore di 2^15 (32768) bit encoder.

E' importante per il corretto funzionamento che il tempo di campionamento del device CANOPEN coincida con tempo di campionamento di tutti i device che utilizzano questo bus di campo. A causa di restrizioni nell'azionamento Danaher il tempo di campionamento deve essere pari ad uno dei seguenti valori: 2,3,4,5,8,10,20 msec.

Diagnosi della rete CAN

Gli errori di comunicazione possono essere monitorati con i parametri errflags, maxrxerr, maxtxerr, busload e maxtraffic del device CANOPEN.
I parametri busload e maxtraffic devono essere utilizzati per verificare l'effettivo utilizzo del bus. Il valore non deve mai superare 80.0%. Questo dato determina anche il numero di azionamenti che è possibile utilizzare. L'utilizzo del bus dipende dai seguenti fattori:

FattoreDescrizione
Tempo di campionamento devicead ogni tempo di campionamento vengono inviate le informazioni di movimento e viene letta la posizione effettiva del motore
velocità CAN busla velocità definisce la durata del messaggio in modo inversamente proporzionale
numero azionamentipiù azionamenti vi sono e più messaggi devono essere inviati nel tempo di campionamento
utilizzo di SDOl'utilizzo di SDO prevede l'invio di messaggi ulteriori fino ad un massimo di un messaggio per ogni tempo di campionamento
errori di comunicazionegli errori di comunicazione alterano il contenuto di un messaggio che verrà immediatamente ritrasmesso aumentando il traffico